package com.imti.mall.product.controller;

import com.imti.mall.common.Api.CommonResult;
import com.imti.mall.product.service.PmsProductAttributeCategoryService;
import com.imti.mall.product.service.PmsProductCategoryAttributeRelationService;
import com.imti.mall.product.service.impl.PmsProductAttributeCategoryServiceImpl;
import io.swagger.models.auth.In;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/api/v1/product/attribute")
public class PmsProductAttributeController {

    @Resource
    private PmsProductCategoryAttributeRelationService pmsProductCategoryAttributeRelationService;
    @Resource
    private PmsProductAttributeCategoryService pmsProductAttributeCategoryService;

    @GetMapping("/findPmsProductCategoryAttributeRelation/{productCategoryId}")
    public CommonResult findPmsProductCategoryAttributeRelation(@PathVariable("productCategoryId") Integer productCategoryId){
        return CommonResult.success(pmsProductCategoryAttributeRelationService.findPmsProductCategoryAttributeRelation(productCategoryId));
    }


    @PostMapping("/category/findProductAttributeCategoryAndProductAttribute")
    public CommonResult findProductAttributeCategoryAndProductAttribute(){
        return CommonResult.success(pmsProductAttributeCategoryService.findProductAttributeCategoryAndProductAttribute());
    }

    /*@PostMapping("/category/findProductAttributeCategoryById")
    public CommonResult fetchProductAttrList(Integer productAttributeCategoryId,Integer pageSize,Integer pageNum,Integer type){
        return null;
    }*/

    /*@PostMapping("/findPmsProductAttribute")
    public  CommonResult fetchList(Integer cid, Integer productAttributeCategoryId, Integer type){
        return null;
    }*/



}
